From: Alexandre Emsenhuber Date: Fri, 22 Jul 2011 10:45:07 +0000 (+0000) Subject: Reduce a bit the coupling between Skin and OutputPage: X-Git-Tag: 1.31.0-rc.0~28687 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=e78acdc3f14234a4408ec0a29c15dad8a630ef89;p=lhc%2Fweb%2Fwiklou.git Reduce a bit the coupling between Skin and OutputPage: * Removed Skin::setupUserCss() and merged it in OutputPage::buildCssLinks() and OutputPage::buildCssLinksArray(), also removed its call from ApiParse.php * Moved Skin::userCanPreview() to OutputPage since two of the three calls to that function are made from there and the last one in SkinTemplate.php is in a somewhat deprecated function * Removed the Skin parameter from OutputPage::buildCssLinks(), OutputPage::getHeadScripts(), OutputPage::getBottomScripts() and OutputPage::makeResourceLoaderLink() since we now have a context Also made ApiParse.php call createContext() instead of create a new RequestContext manually and set its Title so so that it does not rely on $wgRequest and $wgTitle to get that member objects --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2ce48f4b6f..aa80c2ddcc 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2269,7 +2269,6 @@ $templates if ( $sk->commonPrintStylesheet() ) { $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' ); } - $sk->setupUserCss( $this ); $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 'dir' => $userdir ) ); @@ -2286,9 +2285,9 @@ $templates $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n"; $ret .= implode( "\n", array( - $this->getHeadLinks( $sk, true ), - $this->buildCssLinks( $sk ), - $this->getHeadScripts( $sk ), + $this->getHeadLinks( null, true ), + $this->buildCssLinks(), + $this->getHeadScripts(), $this->getHeadItems() ) ); @@ -2397,13 +2396,12 @@ $templates /** * TODO: Document - * @param $skin Skin * @param $modules Array/string with the module name * @param $only String ResourceLoaderModule TYPE_ class constant * @param $useESI boolean * @return string html